﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WebCrawlerTools
{
    abstract class SNode
    {
        public static String URL_TAG = "URL";
        public static String JS_TAG = "JS";
        public static String JS_VAR_TAG = "JS_VAR";
        public static String DUMMY_TAG = "NULL";
        public static String HTML_TAG_S = "<";
        public static String HTML_TAG_E = ">";

        private String text="";

        protected int startPos = -1;
        protected int endPos = -1;

        protected CNodeType type;

        public String Content
        {
            get
            {
                return text;
            }
            set
            {
                text = value;
            }
        }
        public int StartPos
        {
            get
            {
                return startPos;
            }
            set
            {
                startPos = value;
            }
        }
        public int EndPos
        {
            get
            {
                return endPos;
            }
            set
            {
                endPos = value;
            }
        }
        public bool IsKey()
        {
            return type == CNodeType.SKey;
        }

        public bool IsValue()
        {
            return type == CNodeType.SVal;
        }

        public abstract void reset();
    }

    public enum CNodeType
    {
        SKey = 0,
        SVal = 1,
        SPart = 9,
    }
}
